package cn.liuhuan1.api;

import feign.Headers;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;

/**
 * @Auther: liuhuan
 * @Date: 2021/4/7 - 04 - 07 - 20:32
 * @Description:
 * @version: 1.0
 */
@FeignClient("service-fastDfs")
//@Headers({"Content-Type: multipart/form-data","Accept: application/json"})
public interface FastDfsClient {

    @RequestMapping(value = "/fastDfs/uploadFast",method = RequestMethod.POST)
    public String uploadFast(MultipartFile multipartFile);

    @RequestMapping(value = "/fastDfs/upload",method = RequestMethod.POST)
    public String upload(@RequestParam("bytes") byte[] bytes,
                         @RequestParam("fileName") String fileName);

    @RequestMapping(value = "/fastDfs/uploadFile",method = RequestMethod.POST)
    public String uploadFile(File file);

    @RequestMapping(value = "/fastDfs/delFileUrl",method = RequestMethod.POST)
    public Integer delFileUrl(@RequestParam("group") String group,
                              @RequestParam("url") String url);
}
